//
//  TwRequest.h
//  TuiTe
//
//  Created by 张 霄鹤 on 10-3-12.
//  Copyright 2010 xhzhang. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface TwRequest : NSObject {
	NSInteger category;
	NSInteger method;
	NSInteger httpMethod;
	NSInteger format;
	NSInteger authType;
	NSData *authData;
	NSMutableDictionary *params;
	NSMutableDictionary *oaparams;
	NSInteger hasID;

}

@property(nonatomic) NSInteger category;
@property(nonatomic) NSInteger method;
@property(nonatomic) NSInteger httpMethod;
@property(nonatomic) NSInteger format;
@property(nonatomic) NSInteger authType;
@property(nonatomic) NSInteger hasID;
@property(nonatomic,retain) NSData *authData;

/**
 * 创建请求
 * @return TwRequest
 */
- (id)init;

/**
 * 添加请求参数
 * @param value 参数值，一般情况是 NSString, 也有可能是NSData(主要是为了图像上传)
 * @param key   参数名
 */
- (void)putParam:(id)value forKey:(NSString *)key;

- (void)putOAuthParam:(id)value forKey:(NSString *)key;

/**
 * 添加参数
 * @param ps NSDictionary
 */
- (void)putParams:(NSDictionary *)ps;

/**
 * 获取请求数据
 * @return NSData 请求数据体
 */
- (NSData *)getRequestData;

@end
